<script>
  function deepCopy(obj) {
    if (obj === null || typeof obj !== 'object') {
      return obj;
    }

    let newObj = Array.isArray(obj) ? [] : {};

    for (let key in obj) {
      newObj[key] = deepCopy(obj[key]);
    }

    return newObj;
  }

  let arr = ["北京", "上海", { address: "广州" }]
  let arr1 = deepCopy(arr)
  console.log(arr1)
</script>